import { dirname,join } from "path"
import { fileURLToPath } from "url"
import { SUCCESS_MESSAGE } from "../constant/index.js"
export const __dirname = join(dirname(fileURLToPath(import.meta.url)),'../')

//上传图片路径
export const UPLOAD_FILE_PATH=__dirname+"uploads"

export function handlerSuccess(data,k='data'){
    return {...SUCCESS_MESSAGE,[k]:data}
}

export function handlerError(data,error){
    return {data,error}
}
